<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>class使用严格模式</title>
</head>
<body>
    <script>
        // 'use strict'
        // function User(){}
        // User.prototype.show  =  function (){
        //     function test(){
        //         console.log(this);
        //     }
        //     test();
        // }
        
        // let user = new User();
        // user.show();


        // 与严格模式下结果一致
        class User{
            show(){
                function test(){
                    console.log(this);
                }
                test();
            }
        }

        let user = new User();
        user.show();
    </script>
</body>
</html>